{"ast":null,"code":"import _slicedToArray from\"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import React from\"react\";import{LoginForm,PasswordForm,RegistrationForm}from\"../../modules/\";import{Error,AlertBubble}from\"../../components\";import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var Auth=function Auth(){var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),info=_React$useState2[0],setInfo=_React$useState2[1];var _React$useState3=React.useState({current:'login'}),_React$useState4=_slicedToArray(_React$useState3,2),data=_React$useState4[0],setData=_React$useState4[1];var updateData=function updateData(value){setData({current:value});};var updateInfo=function updateInfo(value){setInfo(value);};if(data.current==='registration'){return/*#__PURE__*/_jsxs(\"section\",{className:\"auth\",children:[/*#__PURE__*/_jsx(AlertBubble,{text:'Проверьте почту, чтобы подтвердить активацию аккаунта.',state:info,updateInfo:updateInfo}),/*#__PURE__*/_jsx(Error,{text:\"\\u041F\\u043E\\u043B\\u044C\\u0437\\u043E\\u0432\\u0430\\u0442\\u0435\\u043B\\u044C \\u0441 \\u0442\\u0430\\u043A\\u0438\\u043C \\u0430\\u0434\\u0440\\u0435\\u0441\\u043E\\u043C \\u044D\\u043B\\u0435\\u043A\\u0442\\u0440\\u043E\\u043D\\u043D\\u043E\\u0439 \\u043F\\u043E\\u0447\\u0442\\u044B \\u0438\\u043B\\u0438 \\u043F\\u0441\\u0435\\u0432\\u0434\\u043E\\u043D\\u0438\\u043C\\u043E\\u043C \\u0443\\u0436\\u0435 \\u0441\\u0443\\u0449\\u0435\\u0441\\u0442\\u0432\\u0443\\u0435\\u0442. \\u041E\\u0448\\u0438\\u0431\\u043A\\u0430 \\u0432\\u0430\\u043B\\u0438\\u0434\\u0430\\u0446\\u0438\\u0438.\"}),/*#__PURE__*/_jsx(RegistrationForm,{updateData:updateData,updateInfo:updateInfo})]});}if(data.current==='forgot'){return/*#__PURE__*/_jsxs(\"section\",{className:\"auth\",children:[/*#__PURE__*/_jsx(AlertBubble,{text:'Проверьте почту, чтобы продолжить сброс пароля.',state:info,updateInfo:updateInfo}),/*#__PURE__*/_jsx(Error,{text:\"\\u041F\\u043E\\u043B\\u044C\\u0437\\u043E\\u0432\\u0430\\u0442\\u0435\\u043B\\u044C \\u0441 \\u0442\\u0430\\u043A\\u0438\\u043C \\u0430\\u0434\\u0440\\u0435\\u0441\\u043E\\u043C \\u044D\\u043B\\u0435\\u043A\\u0442\\u0440\\u043E\\u043D\\u043D\\u043E\\u0439 \\u043F\\u043E\\u0447\\u0442\\u044B \\u0438\\u043B\\u0438 \\u043F\\u0441\\u0435\\u0432\\u0434\\u043E\\u043D\\u0438\\u043C\\u043E\\u043C \\u043D\\u0435 \\u0441\\u0443\\u0449\\u0435\\u0441\\u0442\\u0432\\u0443\\u0435\\u0442. \\u041E\\u0448\\u0438\\u0431\\u043A\\u0430 \\u0432\\u0430\\u043B\\u0438\\u0434\\u0430\\u0446\\u0438\\u0438.\"}),/*#__PURE__*/_jsx(PasswordForm,{updateData:updateData,updateInfo:updateInfo})]});}return/*#__PURE__*/_jsxs(\"section\",{className:\"auth\",children:[/*#__PURE__*/_jsx(Error,{text:\"\\u041D\\u0435\\u043A\\u043E\\u0440\\u0440\\u0435\\u043A\\u0442\\u043D\\u043E \\u0432\\u0432\\u0435\\u0434\\u0435\\u043D\\u044B \\u0434\\u0430\\u043D\\u043D\\u044B\\u0435.\"}),/*#__PURE__*/_jsx(LoginForm,{updateData:updateData})]});};export default Auth;","map":{"version":3,"names":["React","LoginForm","PasswordForm","RegistrationForm","Error","AlertBubble","Auth","useState","info","setInfo","current","data","setData","updateData","value","updateInfo"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/src/pages/Auth/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {LoginForm, PasswordForm, RegistrationForm} from \"../../modules/\"\nimport {Error, AlertBubble} from \"../../components\";\n\nconst Auth: React.FC = () => {\n    const [info, setInfo] = React.useState(false);\n    const [data, setData] = React.useState({\n            current: 'login'\n        }\n    );\n\n    const updateData = (value: string) => {\n        setData({ current: value });\n    }\n\n    const updateInfo = (value: boolean) => {\n        setInfo(value);\n    }\n\n    if (data.current === 'registration') {\n        return (\n            <section className='auth'>\n                <AlertBubble text={'Проверьте почту, чтобы подтвердить активацию аккаунта.'} state={info} updateInfo={updateInfo} />\n                <Error text='Пользователь с таким адресом электронной почты или псевдонимом уже существует. Ошибка валидации.' />\n                <RegistrationForm updateData={updateData} updateInfo={updateInfo} />\n            </section>\n        );\n    }\n    if (data.current === 'forgot') {\n\n        return (\n            <section className='auth'>\n                <AlertBubble text={'Проверьте почту, чтобы продолжить сброс пароля.'} state={info} updateInfo={updateInfo} />\n                <Error text='Пользователь с таким адресом электронной почты или псевдонимом не существует. Ошибка валидации.' />\n                <PasswordForm updateData={updateData} updateInfo={updateInfo} />\n            </section>\n        );\n    }\n    return (\n        <section className='auth'>\n            <Error text='Некорректно введены данные.' />\n            <LoginForm updateData={updateData}/>\n        </section>\n    );\n}\n\nexport default Auth;\n"],"mappings":"8IAAA,MAAOA,MAAK,KAAM,OAAO,CACzB,OAAQC,SAAS,CAAEC,YAAY,CAAEC,gBAAgB,KAAO,gBAAgB,CACxE,OAAQC,KAAK,CAAEC,WAAW,KAAO,kBAAkB,CAAC,wFAEpD,GAAMC,KAAc,CAAG,QAAjBA,KAAc,EAAS,CACzB,oBAAwBN,KAAK,CAACO,QAAQ,CAAC,KAAK,CAAC,oDAAtCC,IAAI,qBAAEC,OAAO,qBACpB,qBAAwBT,KAAK,CAACO,QAAQ,CAAC,CAC/BG,OAAO,CAAE,OACb,CAAC,CACJ,qDAHMC,IAAI,qBAAEC,OAAO,qBAKpB,GAAMC,WAAU,CAAG,QAAbA,WAAU,CAAIC,KAAa,CAAK,CAClCF,OAAO,CAAC,CAAEF,OAAO,CAAEI,KAAM,CAAC,CAAC,CAC/B,CAAC,CAED,GAAMC,WAAU,CAAG,QAAbA,WAAU,CAAID,KAA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